//
//  WebViewController.swift
//  VVbo
//
//  Created by Mr.Run on 2017/9/8.
//  Copyright © 2017年 Mr.Run. All rights reserved.
//

import UIKit

class WebViewController: BaseController {

    fileprivate lazy var webView = UIWebView(frame: UIScreen.main.bounds)
    
    var urlString: String? {
        didSet{
            guard let urlString = urlString,
                let url = URL(string:urlString)
                else {
                return
            }
            webView.loadRequest(URLRequest(url: url))
        }
    }
    
}

extension WebViewController{
    
    override func setupTableView() {
        navItem.title = "网页"
        view.insertSubview(webView, belowSubview: navigationBar)
        webView.backgroundColor = UIColor.white
        webView.scrollView.contentInset.top = navigationBar.bounds.height
    }
    
}
